package com.example.openim.controller;

import com.example.openim.service.SubSocketService;
import com.example.openim.utils.AjaxResult;
import io.lettuce.core.dynamic.annotation.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 外放接口
 * @author: xhq
 * @create: 2025-11-13 15:13
 */
@RestController
@RequestMapping("/api/cip/socket")
@Slf4j
public class SubSocketController {


    @Autowired
    private SubSocketService cipRequestService;

    /**
     * 获取消息未读数
     * @param code
     * @return
     */
    @GetMapping("/sub")
    private AjaxResult getSubscript(@Param("subSocket") String code){
        log.info("获取消息未读数,参数："+ code);
        return cipRequestService.getSubscript(code);
    }
}
